<?php
  require_once ('../libraryfiles/config.php');  
  $path = W_ROOT.'/company/edit.php'; 
?>
<?php
	$ch_col = mysql_query("SELECT id,columns,style_path,by_company_id,images FROM tbl_style WHERE by_company_id='".$_SESSION['acc_id']."'");
	$get_col = mysql_fetch_array($ch_col);
	// for get all from theme
	
		
if(isset($_SESSION['username']))
{
	 $email_urlshort=$_SESSION['username'];

	 $userex_short="SELECT *FROM tbluser WHERE email='".$email_urlshort."'";
	 $run_url=mysql_query($userex_short);
	 $ulr_username=mysql_fetch_assoc($run_url);
	 $url_shortname= $ulr_username['username'];
	 $_SESSION['test1']=$url_shortname;
	if(isset($_POST['s_id']))
	{
	$select_compare ="SELECT by_company,style_path FROM tbl_style";
	$run_select=mysql_query($select_compare);
	$row_select=mysql_fetch_array($run_select);
	$_SESSION['test2']=$row_select['by_company'];
	$_SESSION['test3']=$row_select['style_path'];
	$s_id	= $_POST['s_id'];
	if($url_shortname==$row_select['by_company']){
		$update_style=mysql_query("UPDATE tbl_style SET style_path='".$s_id."' ");
	}else{
	$s_insert = mysql_query("INSERT INTO tbl_style (style_path, by_company) VALUE ('".$s_id."','".$url_shortname."')");
	}
	}
}

?>
<!------------header from include -------------------------------->
<?php
    include(S_ROOT.'/includefiles/navmenu.php');
?>
  <!-- End Header and Nav -->
<div class="clear"></div>
<!--header-->
<div class="horiz_m_bg"> 
 <?php
                    $usertype = isset($_SESSION['usertype'])?$_SESSION['usertype']:'';
                    if($usertype == 1){
                        $account = W_ROOT."/admin/";
                        }else if($usertype == 2){
                        $account = W_ROOT."/seller/";	
                        }
	else if($usertype == 3){
                        $account = W_ROOT."/buyer/profile.php";	
                        }else{
                        $account = W_ROOT."/login.php";
                    }
                    ?> 
<div class="row">
    <div class="nine columns">
        <!--start <div class="row1">-->
    	<div class="row">
    	<div class="two columns hide-for-small">
	<a class="logo" href="<?php echo W_ROOT;?>/"><img src="<?php echo W_ROOT;?>/images/Logo200.png" border="0" style="" /></a>
         </div>
         <div class="ten columns hide-for-small">
            <div style="margin-top:10px">
            <div class="row">
                    <div class="twelve columns" style="  margin-left: -90px; margin-top: 60px; width: 850px;">
                        <div class="header_menu ddsmoothmenu" id="smoothmenu1">      
                                <ul class="">      

                                    <li class="selected"><a href="<?php echo W_ROOT;?>#">dashboard</a></li>
                                    <li><a href="<?php echo W_ROOT;?>#">articles</a>
                                          <ul >
                                            <li><a href="<?php echo W_ROOT;?>/seller/product/?view=add">Create new article</a></li>
                                            <li><a href="<?php echo W_ROOT;?>/seller/product/">article manager</a></li>
                                        </ul>
                                    </li> 
                                    <li><a href="<?php echo W_ROOT;?>#">orders</a>     
                                     <li><a href="<?php echo W_ROOT;?>#">accounting</a></li> 
                                    <li><a href="<?php echo W_ROOT;?>#">statistics</a>      
                                    <li><a href="<?php echo W_ROOT;?>#">configuration</a>
                                         <ul >
                                            <li><a href="#">Template manager</a></li>
                                            <li><a href="<?php echo W_ROOT;?>/seller/?p=edit_seller">Edit your profile</a></li>
                                            <li><a href="#">Global configuration</a></li>
                                           
                                        </ul>
                                    </li>   
                                    <li><a href="#">Need Help?</a>
                                        <ul >
                                            <li><a href="#">Contact sales support</a></li>
                                            <li><a href="#">FAQ for seller</a></li>
                                            <li><a href="#">selling guide</a></li>
                                           
                                        </ul>
                                    </li>
                        
                                </ul>
         </div>
                    </div>
                </div>  
    	</div>
            </div>            
        </div>
        <!--end <div class="row1">-->

        <!--start <div class="row2">-->        
    <div class="row">
        <div class="three columns">
      
        </div>
       	
                      
    </div>         
<!--end <div class="row2"> by socheat-->
    </div>
    
    
    <div class="three columns">
        <div style="border: 1px solid #ccc; margin: 11px 0 0 21px ; height: 120px; width:245px; margin-left:-2px;" class="radius2 bo_ddd sad_aaa">
        <div class="ddsmoothmenu" id="smoothmenu1">
            <ul class="myaccount">
                            <li class="user_account" style="float:left;margin-left:-50px;">
                                  <a href="<?php echo $account;?>"><i class="icon-user"></i> My KHM</a>

                                </li>
                                 <li class="user_account" style="float:right;">
                                  <a href="<?php echo W_ROOT;?>#">Messaging</a>

                                </li>
                                   <li class="user_account" style="font-size: 20px; margin-left: 18px;" >
                                  <a href="<?php
                        									$usertype = isset($_SESSION['usertype'])?$_SESSION['usertype']:'';
                        									if($usertype == 1){
                        										$link = W_ROOT."/admin/?logout";
                        										}else if($usertype == 2 ||$usertype == 3){
                        										$link = W_ROOT."/?do=logout";	
                        										}
                        										else
                        										{
                        											if($usertype == 1){
                        												$link = W_ROOT."/admin";	
                        											} 
                        											else 
                        											{
                        										$link = W_ROOT."/login.php";
                        											}
                        									}
                        									?><?php echo $link;?>" class="logout">
                                                        	<?php
                        									$usertype = isset($_SESSION['usertype'])?$_SESSION['usertype']:'';									
                        											if($usertype == 1||$usertype == 2||$usertype == 3){
                        												echo 'Signout';
                        											}
                        											 else
                        											{
                        												echo 'Log in';
                        											}
                        									?>
                                                         	</a>

                                </li>
                </ul>
        </div>               
                <!-- end my card -->
            
        <div class="clear"></div>               
        </div>
        
    </div>
</div>    
        
    
</div>
<!--end header-->

<!------------the end header from include----------------->

<?php include(S_ROOT.'/company/header_top.php');?>
<?php //include(S_ROOT.'/company/header.php');?>
<body> 

<div class="row">
	<?php
		if($get_col['columns']=='1col')
		{
	?>   
    <div class="twelve columns">
    	One Columns  
    </div> 
    <?php
		}
	?>
 	<?php
		if($get_col['columns']=='2col_l')
		{		
	?>
    <div class="three columns">
    	<?php 
    		//include(S_ROOT.'/seller/left.php');
    	?>
    </div> 
    <?php } ?>
        
        <?php
		if($get_col['columns']=='2col_r')
		{		
	?>
    <div class="nine columns">
  
<?php include 'edit_body.php';?>
    </div> 
    <div class="three columns">
       <?php 
    	include(S_ROOT.'/seller/left.php');
    ?>
    <?php 
    	include(S_ROOT.'/seller/left_page.php');
    ?>

    
    </div>
    <?php } ?>
       
  <?php
if($get_col['columns']=='3col') {		
 ?>
    <div class="three columns">
 <?php 
    	include(S_ROOT.'/seller/left.php');
    ?>
    <?php 
        include(S_ROOT.'/seller/left_page.php');
    ?>

    
    </div>
    <?php } ?>
             
</div>
<!--end <div class="row">-->
<!--<div class="row">

 <div class="nine columns">
    
    <?php
    // if have message
    if(!empty($_GET['message']))
    {
        ?>
    <div class="alert alert-block alert-error fade in">
            <button data-dismiss="alert" class="close" type="button">x</button>
            <p style="font-size:16px;"><blink><?php echo $_GET['message'];?></blink></p>
          </div>
      <?php
      }
      // end message
      ?>  
        <style type="text/css">
            .link_style{ position: absolute; margin-top: -27px; margin-left:68px;  }
            .link_style  a{color: #ffffff;}
         </style>
        

        <?php
        if(isset($_SESSION['username']))
            {
       
                            $p=isset($_GET['p'])?$_GET['p']:"change_style";						
                            $page=$p.".php";
                            require_once($page);
            }
        
        ?>
   
    </div>
    <div class="three columns">
        <?php 
    		//include(S_ROOT.'/seller/left.php');
    	?>
    </div>
        
    </div>-->
<p>&nbsp;</p>
<?php include(S_ROOT.'/includefiles/bottom.php');?>
</body>
</html>




